#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPainter>
#include <QImage>
#include <QTimer>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/video/video.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#define FPS 33
using namespace cv;
namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT
    
public:
    explicit Widget(QWidget *parent = 0);
    void paintEvent(QPaintEvent *);
    ~Widget();
private:
    Ui::Widget *ui;
    VideoCapture V;
    QTimer timer;
    Mat im;
    int flag;
    int wh;
    int ht;
    QString size;
    QImage nImg;
//    Qt::WindowFlags flags;
private slots:
    void showImage();
    void init();
    void stop();
    void takephoto();
};

#endif // WIDGET_H
